<template>
	<view class="">
		<view class="mine">
			<view class="header">
				<image class="header_banner" src="../../static/image/mine/header_banner.png" mode=""></image>
				<view class="header_content">
					<view class="header_content_info">
						<image src="../../static/image/mine/header.png" mode=""></image>
						<view class="header_content_info_name">安徒生的谎言真真佳佳</view>
						<view class="vip_ranK">普通会员</view>
					</view>
					<image @tap="toset" class="header_content_set" src="../../static/image/mine/set.png" mode=""></image>
				</view>
				<view class="header_vip">
					<image class="vip_banner" src="../../static/image/mine/vip_banner.png" mode=""></image>
					<view class="vip_info">
						<view class="vip_info_info">
							<image src="../../static/image/mine/logo.png" mode=""></image>
							<view class="line"></view>
							<view class="economy">已为您节省366元</view>
						</view>
						<view class="vip_benefit" @tap="tovipmember">会员权益 ></view>
					</view>
				</view>
			</view>
			<!-- 积分优惠券 -->
			<view class="treasue">
				<view class="treasueItem" @tap="toRedPaper">
					<view class="treasue_num">0.00</view>
					<view class="treasue_title">我的红包</view>
				</view>
				<view class="treasueItem" @tap="lookintegral">
					<view class="treasue_num">162</view>
					<view class="treasue_title">我的积分</view>
				</view>
				<view class="treasueItem" @tap="todiscount">
					<view class="treasue_num">3张</view>
					<view class="treasue_title">优惠券</view>
				</view>
			</view>
			<!-- 订单信息 -->
			<view class="order">
				<view class="order_class">
					<view class="order_class_info" v-for="(item, index) in orderList" :key="index" @tap="lookorder(index)">
						<image class="order_pic" :src="item.src" mode=""></image>
						<view class="order_all_content_info">{{ item.title }}</view>
						<view class="tag"></view>
					</view>
				</view>
				<view class="order_all" @tap="toorder">
					<image src="../../static/image/mine/orderbanner.png" mode=""></image>
					<view class="order_all_content">
						<image class="order_pic" src="../../static/image/mine/order.png" mode=""></image>
						<view class="order_all_content_info">我的订单</view>
					</view>
				</view>
			</view>
			<!-- 积分优惠券 -->
			<view class="integra_discount">
				<view class="integra">
					<view class="integra_info" @tap="lookintegral">
						<view class="integra_info_title">我的积分</view>
						<view class="integra_info_look">
							<text class="integra_num">402</text>
							积分，点击查看
							<text>>></text>
						</view>
					</view>
					<image src="../../static/image/mine/integra.png" mode=""></image>
				</view>
				<view class="line" style="width: 2upx; height: 80upx; background-color: #E1E1E1;"></view>
				<view class="integra" @tap="todiscount">
					<view class="integra_info">
						<view class="integra_info_title">
							优惠券
							<view class="integra_info_title_tag"></view>
						</view>
						<view class="integra_info_look">
							<text class="integra_num">5</text>
							个未使用，点击查看
							<text>>></text>
						</view>
					</view>
					<image src="../../static/image/mine/discount.png" mode=""></image>
				</view>
			</view>
			<!-- 我的服务 -->
			<view class="service">
				<view class="service_title">我的服务</view>
				<view class="service_content">
					<view class="service_content_info" v-for="(item, key) in serviceList" @tap="toservice(key)">
						<image :src="item.src" mode=""></image>
						<view class="service_name">{{ item.title }}</view>
					</view>
				</view>
			</view>
		</view>
		<sign v-if="signflag" @changeflag="changeflag"></sign>
	</view>
</template>

<script>
import sign from '@/components/sign/sign.vue';
export default {
	components: { sign },
	data() {
		return {
			signflag: false,
			orderList: [
				{
					src: '../../static/image/mine/fh.png',
					title: '待发货',
				},
				{
					src: '../../static/image/mine/sh.png',
					title: '待收货'
				},
				{
					src: '../../static/image/mine/ywc.png',
					title: '已完成'
				},
				{
					src: '../../static/image/mine/shouhou.png',
					title: '售后'
				}
			],
			serviceList: [
				{
					src: '../../static/image/mine/service01.png',
					title: '积分商城'
				},
				{
					src: '../../static/image/mine/service02.png',
					title: '领券中心'
				},
				{
					src: '../../static/image/mine/service03.png',
					title: '每日签到'
				},
				{
					src: '../../static/image/mine/service04.png',
					title: '收货地址'
				},
				{
					src: '../../static/image/mine/service05.png',
					title: '联系客服'
				}
			]
		};
	},
	methods: {
		// 去红包页面
		toRedPaper () {
			uni.navigateTo({
				url: '/pageB/redPaper/redPaper'
			})
		},
		lookorder(key) {
			uni.navigateTo({
				url: '/pageD/order/order?id='+(key+2)
			})
		},
		lookintegral () {
			uni.navigateTo({
				url: '/pageA/integral/integral_detail'
			})
		},
		toset() {
			uni.navigateTo({
				url: '/pageD/setting/set'
			});
		},
		toorder() {
			uni.navigateTo({
				url: '/pageD/order/order?id='+0
			});
		},
		tovipmember() {
			uni.navigateTo({
				url: '/pageD/vipbenefit/vipbenefit'
			});
		},
		changeflag() {
			this.signflag = false;
		},
		toservice(key) {
			// if ( key == '3' ) {
			// 	uni.navigateTo({
			// 		url: '/pageD/adress/adress'
			// 	})
			// }
			switch (key) {
				case 0:
					uni.navigateTo({
						url: '/pageA/integral/integral'
					});
					break;
				case 1:
					uni.navigateTo({
						url: '/pageD/discount/center'
					});
					break;
				case 2:
					this.signflag = true;
					break;
				case 3:
					uni.navigateTo({
						url: '/pageD/adress/adress'
					});
					break;
				default:
					break;
			}
		},
		todiscount() {
			uni.navigateTo({
				url: '/pageD/discount/discount'
			});
		}
	}
};
</script>

<style>
page {
	background-color: #f8f8f8;
	overflow: hidden;
}
</style>
<style lang="less" scoped>
@import url('../../static/scss/mine/mine.less');
</style>
